//引入exress模块
const express = require('express');
//引入连接池模块
const pool = require('../pool.js');
//创建路由器对象
const r = express.Router();
//   时令食材页面
r.get('/class/fashion', (req, res) => {
    //SQL语句以获取时令食材表的数据
    let sql = 'SELECT fid,f_title,f_img FROM xcf_surface';
    //执行SQL语句
    pool.query(sql, (err, results) => {
        if (err) throw err;
        res.send({
            message: 'ok',
            code: 200,
            results: results
        });
    });
});
module.exports = r;